<?php
/**
 * Created by PhpStorm.
 * User: jhon
 * Date: 2018/2/8
 * Time: 10:50
 */
namespace app\api\controller;

class Index extends Auto {

    protected $rule =   [
        'name'  => 'require|max:25',
        'age'   => 'number|between:1,120',
        'email' => 'email',
    ];

    protected $message  =   [
        'name.require' => '名称必须',
        'name.max'     => '名称最多不能超过25个字符',
        'age.number'   => '年龄必须是数字',
        'age.between'  => '年龄只能在1-120之间',
        'email'        => '邮箱格式错误',
    ];

    protected $scene = [
        'edit'  =>  ['name','age'=>'require|number|between:1,120'],
    ];

    public function index(){
        return json(['message'=>"ems开放平台！",'error'=>'0','data'=>[]]);
    }

}